package com.hfi.ood.atmsimulator.model;

import com.hfi.ood.atmsimulator.Atm;

import java.util.Scanner;

/**
 * @author ChangLiang
 * @date 2020/5/21
 */
public class Keyboard {

    public String readInput() {
        // ide use javaw, so null
//        return System.console().readLine("> ");

        /*BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        return br.readLine();*/

        Scanner scanner = new Scanner(System.in);
        return scanner.nextLine();
    }

    public String readPassword(Atm atm) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        int length = s.length();
        StringBuilder builder = new StringBuilder();
        while (length-- != 0) {
            builder.append("*");
        }
        atm.display(builder.toString());
        return s;
    }
}
